﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ksp.view
{
    public partial class Ship : Form
    {
        public Ship()
        {
            InitializeComponent();
        }

        private void öffnenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialogShip.ShowDialog();
            try
            {
                String[] l = System.IO.File.ReadAllLines(openFileDialogShip.FileName);
                List<String> lines = l.ToList();
                shipBindingSource.Add(Controller.ShipParser.ParseShip(lines));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void schließenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            shipBindingSource.RemoveCurrent();
        }
    }
}
